<template>
  <div>-----文字展开-----</div>
  <div class="text-unfold">不忘初心，始终如一</div>
  <el-button @click="changeA">msg++</el-button>
  <child></child>
</template>
<script>
import { provide, ref } from "vue";
import child from "./components/ChiLd.vue";

export default {
  name: "newS",
  components: { child },
  setup() {
    const a = ref(0);
    provide("msg", { a, changeA });
    function changeA() {
      a.value++;
      console.log(a);
    }

    // 获取数组的原型Array.prototype，上面有我们常用的数组方法
    const arrayProto = Array.prototype;
    // 创建一个空对象arrayMethods，并将arrayMethods的原型指向Array.prototype
    const arrayMethods = Object.create(arrayProto);
    console.log("arrayMethods", arrayMethods);

    return {
      changeA,
    };
  },
};
</script>
<style lang="scss" scoped>
.text-unfold {
  color: red;
  font-size: 38px;
  text-align: center;
  // animation: textUnfold 1.5s infinite;
}
@keyframes textUnfold {
  from {
    letter-spacing: -38px;
  }
  to {
    letter-spacing: 0;
  }
}
</style>
